/*
 * @Author: your name
 * @Date: 2021-10-01 00:13:51
 * @LastEditTime: 2021-10-01 00:14:53
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \express-seed\utils\utils.js
 */
const os = require('os');

module.exports = {
    //获取本机ip地址
    getIPAdress() {
        var interfaces = os.networkInterfaces();
        for (var devName in interfaces) {
            var iface = interfaces[devName];
            for (var i = 0; i < iface.length; i++) {
                var alias = iface[i];
                if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal) {
                    return alias.address;
                }
            }
        }
    }
}